package com.qd.common.sys.domain.entity.role;

import com.cdqidi.valid.group.DefaultGroup;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * @author sjk
 * 角色和菜单
 */
@Data
@Accessors(chain = true)
public class RoleMenuDTO {
    /**
     * 主键
     */
    private String roleMenuId;
    /**
     * 角色ID
     */
    @Size(max = 50, message = "角色ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String roleId;
    /**
     * 角色ID显示值
     */
    private String roleIdDisplay;
    /**
     * 菜单ID
     */
    @Size(max = 50, message = "功能ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String menuId;
    /**
     * 菜单ID显示值
     */
    private String menuIdDisplay;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    public void freeData() {
        this.roleMenuId = null;
        this.roleId = null;
        this.roleIdDisplay = null;
        this.menuId = null;
        this.menuIdDisplay = null;
        this.addTime = null;
        this.updateTime = null;
    }
}
